package mn.idax.exchange.otc.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import mn.idax.exchange.otc.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import mn.idax.exchange.otc.entity.OTCUser;
import mn.idax.exchange.otc.entity.OTCUserExample;

public interface OTCUserMapper {
    int countByExample(OTCUserExample example);

    int deleteByExample(OTCUserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(OTCUser record);

    int insertSelective(OTCUser record);

    List<OTCUser> selectByExampleWithBLOBsWithRowbounds(OTCUserExample example, RowBounds rowBounds);

    List<OTCUser> selectByExampleWithBLOBs(OTCUserExample example);

    List<OTCUser> selectByExampleWithRowbounds(OTCUserExample example, RowBounds rowBounds);

    List<OTCUser> selectByExample(OTCUserExample example);

    OTCUser selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") OTCUser record, @Param("example") OTCUserExample example);

    int updateByExampleWithBLOBs(@Param("record") OTCUser record, @Param("example") OTCUserExample example);

    int updateByExample(@Param("record") OTCUser record, @Param("example") OTCUserExample example);

    int updateByPrimaryKeySelective(OTCUser record);

    int updateByPrimaryKeyWithBLOBs(OTCUser record);

    int updateByPrimaryKey(OTCUser record);


    //获取信任名单或者黑名单
    List<UserPageListDTO> getUserGroupList(UserPageParamsDTO userPageParamsDTO);

    //获取黑名单list
    List<UserPageListDTO> getUserBlackList(@Param("userId")Integer userId);

    Integer getUserGroupTotal(UserPageParamsDTO userPageParamsDTO);
    
    OTCUserADSummaryDTO selectByUserId(Integer userId);

    int updateOTCUser(OTCUserGoodRate otcUserGoodRate);

    //信任名单数
    int getUserCollectionTrustUser(@Param("userId") Integer userId);

    //黑名单数
    int getUserCollectionDistrustUser(@Param("userId")Integer userId);
    
    OTCUser getOTCUserByUniqueKey(String uniquekey);
    
    OTCUserADSummaryDTO getSummaryByUserId(Integer userId);
    
    Date getLastLogintime(Integer userId);

    //获取订单详情的user信息
    UserInfoResultDTO getUserInfo(@Param("userId")Integer userId);

    int updateIsUpdatedTrue(@Param("userId")Integer userId);

    int updateTradenumberAndTurnover(Map<String,Object> conditionMap);

    int syncOtcUser();

    String getUserIconUrl(@Param("userId")Integer userid);
}